Size: a a a

2020 February 13

SA

Sokolov Andrew in Lisp Forever
лишний кусок
источник

O

O in Lisp Forever
Как я понял это случай только в CL так обрабатывается, посмотрите мой пример из Питона
источник

SA

Sokolov Andrew in Lisp Forever
CL-USER> (* (sqrt 10) (sqrt 10))
10.0
CL-USER> (* (coerce (sqrt 10) 'double-float) (coerce (sqrt 10) 'double-float))
10.000000242536998d0
источник

SA

Sokolov Andrew in Lisp Forever
вопрос чисто в том как округление устроено
источник

SA

Sokolov Andrew in Lisp Forever
и дело конечно не в CL а в sbcl
источник

SA

Sokolov Andrew in Lisp Forever
я ответил на вопрос?
источник

O

O in Lisp Forever
Извени, буду  прбовать дома, на работе урывками поглядел, вроде понятно. Спасибо @Commander_Trashdin
источник

O

O in Lisp Forever
остановился на функции такого вида

(defun fig-square-p (n)
 "Check if the given N is a perfect square number.

A000290 in the OEIS"
 (check-type n (integer 0 *))
 (= (floor (sqrt n)) (ceiling (sqrt n))))
источник
2020 February 14

O

O in Lisp Forever
Но фигня какая то все равно
источник

O

O in Lisp Forever
(defun fig-square-p (n)
 "Check if the given N is a perfect square number.

A000290 in the OEIS"
 (check-type n (integer 0 *))
 (= (floor (sqrt n)) (ceiling (sqrt n))))

(defun fibonaccip (n)
 "Check if the given number N is a Fibonacci number."
 (check-type n (integer 0 *))
 (or (fig-square-p (+ (* 5 (expt n 2)) 4))
     (fig-square-p (- (* 5 (expt n 2)) 4))))
источник

O

O in Lisp Forever
(defun fibonacci (n)
 "Compute N's Fibonacci number."
 (check-type n (integer 0 *))
 (loop :for f1 = 0 :then f2
    :and f2 = 1 :then (+ f1 f2)
    :repeat n :finally (return f1)))
источник

O

O in Lisp Forever
(defun seq-fibonaccies (n)
 "Return sequence of Fibonacci numbers upto N."
 (check-type n (integer 0 *))
 (loop :for i :from 1 :upto n
    :collect (fib i)))
источник

O

O in Lisp Forever
PEHU> (loop :for i :from 0 :upto 7070 :when (fibonaccip i) :collect i)
(0 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 2889 3876 4181 5473
6765 7070)
PEHU> (seq-fibonaccies 21)
(1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946)
источник

O

O in Lisp Forever
источник

AE

Alexey Egorov in Lisp Forever
Привет.
источник

AE

Alexey Egorov in Lisp Forever
Как думаете, что это?
источник

AE

Alexey Egorov in Lisp Forever
GitHub - Bike/mother: what is the soul of man when soul and body seperates body dies soul lives fear not man which can only destroy the body, but fear him which is able to destroy both soul and body in hell. dead destruction is bad! but living destruction…
https://github.com/Bike/mother
источник

YK

Yaroslav Khnygin in Lisp Forever
Alexey Egorov
GitHub - Bike/mother: what is the soul of man when soul and body seperates body dies soul lives fear not man which can only destroy the body, but fear him which is able to destroy both soul and body in hell. dead destruction is bad! but living destruction…
https://github.com/Bike/mother
шизофрения?
источник

SA

Sokolov Andrew in Lisp Forever
Действительно
источник

SA

Sokolov Andrew in Lisp Forever
Достаточно тяжёлый случай кажется
источник