Okay, I did a bit of testing it happens when the value of *Scl is 1 or more. You get a similar result if you add or subtract, two or more numbers which are not in the same format; Like one without decimal and the other with a decimal.

Make sure all the values are in decimal format with scl set properly. Most things should be OK. (load '@lib/math.l) (exp 2) -> 1000002 (exp 9) -> 1000009 (scl 1) (+ 1 1.0) -> 11 (- 1.0 1) -> -9 (+ 1.0 1.0) -> 20 -------- Original Message -------- On 29 Jan 2018 10:10 am, PositronPro wrote: > I can't answer why it returns 1000001 for (exp 1). > > You can try (exp 1.0) it returns 2718282. This works fine till scl is 8 or > less, anything more it simply returns T. > > (load '@lib/math.l) > (exp 1) > -> 1000001 > > (exp 1.0) > ->2718282 > > (scl 8) > (exp 1.0) > -> 2688...200 (50 digits number) > > (scl 9) # or any bigger value like 11 > -> T > -------- Original Message -------- > On 29 Jan 2018 3:49 am, Henrik Sarvell < hsarv...@gmail.com> wrote: > >> Hi list, long time no see! >> The definition of exp in math.l leads me to believe that we're calling this >> C function: >> https://www.tutorialspoint.com/c_standard_library/c_function_exp.htm >> >> Since we can't do floating numbers in PL and I notice that math.l uses (scl >> 6) I would hope to get get something like 2718281 back from this call: >> (println (exp 1)). >> But that is not happening, instead I get 1000001. >> Related is my current project which is converting this naive / simple neural >> network written in Python to PL: >> https://medium.com/technology-invention-and-more/how-to-build-a-simple-neural-network-in-9-lines-of-python-code-cc8f23647ca1 >> >> Where I'm currently stuck on the sigmoid function which in turn is making >> use of exp.