the floating point

By Jorika ·
I am running pastel 5.2 on windows xp. when i am entering data into a batch, from time to time i get the following error message 'the floating point of the square root is negative'. then my pastel shuts down and i have to restart my computer. someone told me that there is something wrong with my database. i am getting very frustrated!

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

A square root can always be negative

by Tony Hopkinson In reply to the floating point

The square root of 4 can be 2 or -2 for instance. At a guess I'd say your are getting an overflow error.
e.g. a signed byte has a range of -128 to +127, unsigned 0 to +255, so if you take 128 unsigned as signed you end up with -1

You can get similar problems with floting point types. Make sure they are all the biggest type you use in your database. e.g all double, all Decimal(8,3) or whatever Pastel uses, might do the trick.

Collapse -

floating point

by Jorika In reply to A square root can always ...

Hi Tony,
Thanks for the advice, but you are clearly much smarter with these kind of things than I am. How do I go about ensuring I use the biggest type in my database. I am entering a normal transaction into my cash book and it throws me out with the error message.

Collapse -

Hmm I knew nothing about Pastel

by Tony Hopkinson In reply to floating point

had a quick look and it uses tech I'm not familiar with. I can't really advise you on this one. This might be a feature, or more likely a bug, I suggest you get in touch with pastel themselves, or if there is one a user group / community.

The scary bit is I'm pretty sure I can't think of a single reason why a cash book entry would ever need to figure out a square root, so the error is looking spurious for starters.

Related Discussions

Related Forums