Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:52 08 Sep 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : math(log10 0) problem

Author Message
ville56
Regular Member

Joined: 08/06/2022
Location: Austria
Posts: 75
Posted: 07:23pm 26 Jul 2024
Copy link to clipboard 
Print this post

Peter,

just stepped on another mine ....

a=math(log10 0) executes with no error
but a subsequent "print a" throws

Error: Invalid address - resetting

the same error is thrown with "print math(log10 0)"

I would have expected an error of course with log(0) (something like "infinite result") but not a cpu restart when printing a variable afterwards.

Regards,
Gerald
                                                                 
73 de OE1HGA, Gerald
 
ville56
Regular Member

Joined: 08/06/2022
Location: Austria
Posts: 75
Posted: 07:28pm 26 Jul 2024
Copy link to clipboard 
Print this post

... same happens for negative arguments ....

Gerald
                                                                 
73 de OE1HGA, Gerald
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8809
Posted: 10:27pm 26 Jul 2024
Copy link to clipboard 
Print this post

Easily fixed but all it can do is create an error (play with log function) so you will need to code round it.
 
ville56
Regular Member

Joined: 08/06/2022
Location: Austria
Posts: 75
Posted: 04:31am 27 Jul 2024
Copy link to clipboard 
Print this post

an error would be great as this would be in line with e.g. SQR() function throwing an error on negative values. So only the log10(0) is a new type of error i suppose.
                                                                 
73 de OE1HGA, Gerald
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024