ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
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)
<tankf33der> ?
<Regenaxer> You must divide by 1.0 as many times as the second arg
<Regenaxer> on phone
<Regenaxer> done
<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?
<tankf33der> 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> hehe
<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.
<tankf33der> http://ix.io/24R5
<Regenaxer> yeah
<Regenaxer> Not sure
<tankf33der> afk.
beneroth has quit [Ping timeout: 265 seconds]
beneroth has joined #picolisp
<beneroth> tankf33der, maybe ricks blog can help you as a reference: https://the-m6.net/blog/fixed-point-arithmetic-in-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?
<tankf33der> yea.
<Regenaxer> indeed tough
<tankf33der> http://ix.io/24RN
<tankf33der> afk.
<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]