|
hav Wanderer
Joined: 05 Oct 2004 Posts: 61 Location: Riga, Latvia
|
Posted: Sat Aug 19, 2006 7:48 pm
[1.05] float numbers |
entering a text containing number with dot into command line gives 'error in floating point value'. Trying to send said error gives 'Sorry, sending the bug report didn't work'. First time i tried it, cmud also crashed, seems rare occurance, not sure on exact conditions when it crashes, mostly just the parse error.
|
|
|
|
hav Wanderer
Joined: 05 Oct 2004 Posts: 61 Location: Riga, Latvia
|
Posted: Sat Aug 19, 2006 8:02 pm |
Nevermind, just entering 5 without any decimals in the middle of text crashed too.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Aug 19, 2006 9:30 pm |
Where are you entering this number? Just into the main command line? Can anyone else reproduce this?
|
|
|
|
hav Wanderer
Joined: 05 Oct 2004 Posts: 61 Location: Riga, Latvia
|
Posted: Sat Aug 19, 2006 9:32 pm |
Yep. Main command line, blank settings. Just wanted to boast on guild line how I'm running cmud 1.05 and blam, that crashed it *sniff*. Reproducing is easy, open blank window, enter number into command line and voila. And by that I mean the parse number involving decimals. Crash involving any number including whole, not sure, not occuring every time.
|
|
Last edited by hav on Sat Aug 19, 2006 9:37 pm; edited 1 time in total |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Aug 19, 2006 9:36 pm |
As I said, I can't reproduce this at all. I ran CMUD, pressed ESC to close the session window, then typed:
1.05
in the command line and it worked fine. So I'm going to need more details on this. |
|
|
|
hav Wanderer
Joined: 05 Oct 2004 Posts: 61 Location: Riga, Latvia
|
Posted: Sat Aug 19, 2006 9:38 pm |
Not sure, changed default settings but not by much. Changed colours around, turned off echo, spellchecker, MXP and GSL. thats about it I think. Weird.
I'll try a fresh install and do it again step by step, see at what point parse errors appear.
Edit: Uninstalled, scorched install folder with napalm (very messy uninstaller, leaves tons of files behind), reinstalled. Closed sessions window leaving blank 'untitled' window. Typed in 1.05. Parse error.
Edit2: Just to be crystal clear added screen grab.
|
|
|
|
Rorso Wizard
Joined: 14 Oct 2000 Posts: 1368
|
Posted: Sat Aug 19, 2006 10:30 pm |
zScript has a bug with floats and non US systems. The problem is that different countries have different ways to represent floats.
In US what is 1.08 becomes 1,08 on a Swedish system. zScript adapts(or tries) to handle floats the same way as suggested by Windows National settings(check control panel). It would be good if zScript just always used the decimal point(.) no matter what settings the OS uses. That way scripts would be more compatible.
And on top of it... zScript totally fails to work with the Swedish notation anyway :P.
#echo %eval(%float(1) / %float(2))
Result: Gives no answer
If I change it to US notation in control panel:
Result: 0.5 |
|
|
|
hav Wanderer
Joined: 05 Oct 2004 Posts: 61 Location: Riga, Latvia
|
Posted: Sat Aug 19, 2006 10:35 pm |
Duhhh, why didn't I think of it. Yes, changing regional settings to US fixes it. Strange, has never been that much of a problem in zmud.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Aug 19, 2006 10:52 pm |
Thanks for the details on this.
The issue is that the parser is looking for the decimal point, but then when it calls the Windows routines to convert floating point, Windows is looking for a comma.
What I'm going to need to do is write my own floating point conversion routines and force the use of the period.
I won't be able to support the comma for floating point because of the confusion causes in functions. For example, is:
%function( 1,23)
a single floating-point argument, or two integer arguments. This is an issue in any programming language that uses commas to separate arguments in function calls.
Anyway, I'll try to put in my own floating point stuff and try to bypass the Windows settings in a future version. For now just set your Windows settings to use a decimal point. |
|
|
|
|
|