beneroth has quit [Quit: Leaving]
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #picolisp
_whitelogger has joined #picolisp
f8l has quit [Remote host closed the connection]
f8l has joined #picolisp
_whitelogger has joined #picolisp
orivej has quit [Ping timeout: 268 seconds]
rob_w has joined #picolisp
beneroth has joined #picolisp
<
tankf33der>
Regenaxer: having fun fixed point math again
<
Regenaxer>
good :)
<
tankf33der>
how to implement (** 23.3 45.23)
<
Regenaxer>
You must divide by 1.0 as many times as the second arg
<
Regenaxer>
on phone
<
Regenaxer>
minus one
<
Regenaxer>
But on each step, otherwise the numbers get huge
<
tankf33der>
because exp available via @lib/math.l
<
Regenaxer>
only as float, right?
<
Regenaxer>
So not useful here?
<
tankf33der>
can be used, im surfing and understand task yet.
<
Regenaxer>
It said at least 32 digits
<
Regenaxer>
A simple solution might be:
<
Regenaxer>
(scl 6)
<
Regenaxer>
(*/ (** N E) (** 1.0 (dec E))) )
<
Regenaxer>
(de f** (N E)
<
Regenaxer>
(prinl (format (f** 2.0 3) *Scl))
<
Regenaxer>
This assumes that E is a small integer
<
Regenaxer>
Double floats support maximally 15 digits
<
tankf33der>
no chances.
<
Regenaxer>
no chances for E being an integer?
<
tankf33der>
no chances to implement all this myself. every time i touch math and fixed point math im starting from scratch.
<
Regenaxer>
I think it is simple once you got the point
<
Regenaxer>
Only divide after mul, and multiply before div
<
Regenaxer>
Both with '*/'
<
tankf33der>
works.
<
tankf33der>
but what about (f** 22.3 3.2) ?
<
Regenaxer>
Good question
<
tankf33der>
because this is exp function.
<
Regenaxer>
Not sure
beneroth has quit [Ping timeout: 265 seconds]
beneroth has joined #picolisp
<
tankf33der>
yea, known.
<
Regenaxer>
The problem is the math itself
<
Regenaxer>
I don`t know how to scale fractional exponents
<
Regenaxer>
eg (** 7.0 0.5) is in fact square root
rob_w has quit [Remote host closed the connection]
orivej has joined #picolisp
beneroth has quit [Ping timeout: 268 seconds]
orivej has quit [Ping timeout: 258 seconds]
<
tankf33der>
i will do this one
<
Regenaxer>
gave up on exponentiation?
<
Regenaxer>
indeed tough
<
Regenaxer>
instead of quote you can use 'de'
orivej has joined #picolisp
xkapastel has joined #picolisp
orivej has quit [Ping timeout: 265 seconds]
<
tankf33der>
i will try
orivej has joined #picolisp
DerGuteMoritz has quit [Quit: WeeChat 1.6]
DerGuteMoritz has joined #picolisp
beneroth has joined #picolisp
orivej has quit [Ping timeout: 268 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
f8l has quit [Remote host closed the connection]
f8l has joined #picolisp
orivej has joined #picolisp
orivej has quit [Ping timeout: 258 seconds]