remainder / fmod not working with math32

ZX80, ZX 81, ZX Spectrum, TS2068 and other clones
Post Reply
nthunter
New member
Posts: 4
Joined: Mon Apr 24, 2023 7:10 pm

remainder / fmod not working with math32

Post by nthunter »

Hi there!

I'm trying to use the equivaled of remainder/fmod/& with math32 on zxn target (classic), but neither fmod nor remainder work. I can't find remainder implemented on math32, but fmod is there -- but when used, gives me this error message:

Code: Select all

../../_DEVELOPMENT/math/float/math32/lm32/c/sccz80/fmod_callee.asm:12: error: undefined symbol: cm32_sdcc_fmod_callee
  ^---- cm32_sdcc_fmod_callee
../../_DEVELOPMENT/math/float/math32/lm32/c/sccz80/fmod_callee.asm:12: error: undefined symbol: _fmod_callee
  ^---- cm32_sdcc_fmod_callee
Is there another way to use fmod or is it not yet implemented in math32?

Thanks for any help!
nthunter
New member
Posts: 4
Joined: Mon Apr 24, 2023 7:10 pm

Re: remainder / fmod not working with math32

Post by nthunter »

(Sorry, I meant "remainder/fmod/%" and not "&") :)
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: remainder / fmod not working with math32

Post by dom »

I've reproduced this, understand what's causing it, know how to fix it, but I'm confused as to why it's been done the way it has so I've asked @felipu if I've missed something.

In the mean time x - (int)x will get you the remainder!
User avatar
feilipu
Member
Posts: 45
Joined: Tue Nov 15, 2016 5:02 am

Re: remainder / fmod not working with math32

Post by feilipu »

Working on this here, now. But it may be some time until we can fix it.
Sorry about the confusion.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: remainder / fmod not working with math32

Post by dom »

I ended up being distracted by other maths libraries, but I've merged a fix for this and added in the missing remainder #define
User avatar
feilipu
Member
Posts: 45
Joined: Tue Nov 15, 2016 5:02 am

Re: remainder / fmod not working with math32

Post by feilipu »

We did some further fixing (a few days ago) so now the nightly builds should be OK. Could you please check its working as hoped?
Post Reply