Float assignment totally unexpected
Hello everybody! I'm running miniaudicle for ubuntu 13.10. everything compiles and even sound works. i'm just facing an unexpected behaviors with floats. <<< 12.2 >>> prints 12.000000 : (float) <<< 1.2 * 2.2 >>> prints 2.00000 : (float) 2.3 => float a; <<< a >>> prints 2.000000 : (float) i really want to solve this out as soon as possible. any advices? is a gcc/g++ issue? is chuck language issue?
That's really bizarre
brian@brian-work-laptop ~ $ cat float-issue.ck
2.3 => float a;
<<< a >>>;
brian@brian-work-laptop ~ $ chuck float-issue.ck
2.300000 :(float)
I'm on Mint 15 and
brian@brian-work-laptop ~ $ chuck --version
chuck version: 1.3.3.0 (chimera)
linux (alsa) : 64-bit
On Wed, Mar 26, 2014 at 8:41 AM, alfredo
Hello everybody!
I'm running miniaudicle for ubuntu 13.10.
everything compiles and even sound works.
i'm just facing an unexpected behaviors with floats.
<<< 12.2 >>> prints 12.000000 : (float) <<< 1.2 * 2.2 >>> prints 2.00000 : (float)
2.3 => float a; <<< a >>> prints 2.000000 : (float)
i really want to solve this out as soon as possible.
any advices? is a gcc/g++ issue? is chuck language issue?
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
i tried on different machines (32bit /64bit), changed to debian. unluckly
got the same result.
i'm using miniaudicle 1.3.1 and chuck source 1.3.3
my gcc version is 4.8.1
my g++ version is 4.8.1
2014-03-26 15:41 GMT+01:00 Brian Sorahan
That's really bizarre
brian@brian-work-laptop ~ $ cat float-issue.ck 2.3 => float a; <<< a >>>; brian@brian-work-laptop ~ $ chuck float-issue.ck 2.300000 :(float)
I'm on Mint 15 and
brian@brian-work-laptop ~ $ chuck --version
chuck version: 1.3.3.0 (chimera) linux (alsa) : 64-bit
On Wed, Mar 26, 2014 at 8:41 AM, alfredo
wrote: Hello everybody!
I'm running miniaudicle for ubuntu 13.10.
everything compiles and even sound works.
i'm just facing an unexpected behaviors with floats.
<<< 12.2 >>> prints 12.000000 : (float) <<< 1.2 * 2.2 >>> prints 2.00000 : (float)
2.3 => float a; <<< a >>> prints 2.000000 : (float)
i really want to solve this out as soon as possible.
any advices? is a gcc/g++ issue? is chuck language issue?
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Alfredo,
to locate a cause I'll suggest you to experiment avoiding miniaudicle,
using command line.
2014-03-26 17:35 GMT+02:00 alfredo
i tried on different machines (32bit /64bit), changed to debian. unluckly got the same result.
i'm using miniaudicle 1.3.1 and chuck source 1.3.3
my gcc version is 4.8.1 my g++ version is 4.8.1
Using formerly compiled ChucK - $ chuck --version chuck version: 1.3.1.3 (chimera) linux (jack) : 32-bit I got as expected - $ cat float-issue.ck 2.3 => float a; <<<a>>>; $ chuck float-issue.ck 2.300000 :(float) Antanas Budriūnas
chuck --version
chuck version: 1.3.3.0 (chimera)
linux (alsa) : 64-bit
http://chuck.cs.princeton.edu/
http://chuck.stanford.edu/
nano float-issue.ck
2.3 => float a;
<<< a >>>;
chuck float-issue.ck
2.300000 : (float)
unbelievable... but mini-audicle still doesn't work
can it be the dependencies?
2014-03-26 18:20 GMT+01:00 Antanas Budriūnas
Alfredo,
to locate a cause I'll suggest you to experiment avoiding miniaudicle, using command line.
2014-03-26 17:35 GMT+02:00 alfredo
: i tried on different machines (32bit /64bit), changed to debian. unluckly got the same result.
i'm using miniaudicle 1.3.1 and chuck source 1.3.3
my gcc version is 4.8.1 my g++ version is 4.8.1
Using formerly compiled ChucK -
$ chuck --version chuck version: 1.3.1.3 (chimera) linux (jack) : 32-bit
I got as expected -
$ cat float-issue.ck 2.3 => float a; <<<a>>>; $ chuck float-issue.ck 2.300000 :(float)
Antanas Budriūnas _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
I don't use the mA at all, but I just built it (1.3.1. gidora) and ran your
example and did not see this issue.
Did you maybe build mA against an older, crappier version of chuck?
On Wed, Mar 26, 2014 at 2:23 PM, alfredo
chuck --version
chuck version: 1.3.3.0 (chimera) linux (alsa) : 64-bit http://chuck.cs.princeton.edu/ http://chuck.stanford.edu/
nano float-issue.ck 2.3 => float a; <<< a >>>;
chuck float-issue.ck 2.300000 : (float)
unbelievable... but mini-audicle still doesn't work
can it be the dependencies?
2014-03-26 18:20 GMT+01:00 Antanas Budriūnas
: Alfredo,
to locate a cause I'll suggest you to experiment avoiding miniaudicle, using command line.
2014-03-26 17:35 GMT+02:00 alfredo
: i tried on different machines (32bit /64bit), changed to debian. unluckly got the same result.
i'm using miniaudicle 1.3.1 and chuck source 1.3.3
my gcc version is 4.8.1 my g++ version is 4.8.1
Using formerly compiled ChucK -
$ chuck --version chuck version: 1.3.1.3 (chimera) linux (jack) : 32-bit
I got as expected -
$ cat float-issue.ck 2.3 => float a; <<<a>>>; $ chuck float-issue.ck 2.300000 :(float)
Antanas Budriūnas _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
2014-03-26 21:23 GMT+02:00 alfredo
chuck --version
chuck version: 1.3.3.0 (chimera) linux (alsa) : 64-bit http://chuck.cs.princeton.edu/ http://chuck.stanford.edu/
nano float-issue.ck 2.3 => float a; <<< a >>>;
chuck float-issue.ck 2.300000 : (float)
unbelievable... but mini-audicle still doesn't work
can it be the dependencies?
I didn' t use mini but seems (s)hi had the problem long time ago - https://lists.cs.princeton.edu/pipermail/chuck-users/2006-November/001309.ht... Antanas Budriūnas
Hey Alfredo/all,
I dont have any specific recollection of this issue coming up, but the
thread Antanas has linked to is promising. It could be a locale issue,
which sadly seems to still be an issue in some situations :( One side
effect of these is software being confused whether , or . is the decimal
separator for floating point literals, which might explain the
misrepresentations you are seeing.
To test this, try setting to miniAudicle to the "C" locale before running
it, by setting the appropriate locale environment variable. Its been a
while, but I believe LC_ALL is the right var. For example,
$ export LC_ALL="C"
$ miniAudicle
and then proceed as normal. (The locale settings will only apply to the
current terminal, so this shouldnt affect anything else on your system.)
There are a few more locale-oriented settings that can be manipulated, so
some experimentation may be necessary.
If it is a locale issue, then its probably something we can fix in
miniAudicle very easily. Let me know!
Thanks,
spencer
On Wed, Mar 26, 2014 at 12:50 PM, Antanas Budriūnas
2014-03-26 21:23 GMT+02:00 alfredo
: chuck --version
chuck version: 1.3.3.0 (chimera) linux (alsa) : 64-bit http://chuck.cs.princeton.edu/ http://chuck.stanford.edu/
nano float-issue.ck 2.3 => float a; <<< a >>>;
chuck float-issue.ck 2.300000 : (float)
unbelievable... but mini-audicle still doesn't work
can it be the dependencies?
I didn' t use mini but seems (s)hi had the problem long time ago -
https://lists.cs.princeton.edu/pipermail/chuck-users/2006-November/001309.ht...
Antanas Budriūnas _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Hi spencer/all...
finally! it seems that is a locale problem.
doing export LC_ALL="C" before running miniaudicle it works perfectly.
thanks a lot...
hope it helps to fix that.
thanks to everybody for the quick answer.
still congratulations for the excellent language/software that personally i
love.
sincerely,
alfredo
2014-03-26 21:15 GMT+01:00 Spencer Salazar
Hey Alfredo/all,
I dont have any specific recollection of this issue coming up, but the thread Antanas has linked to is promising. It could be a locale issue, which sadly seems to still be an issue in some situations :( One side effect of these is software being confused whether , or . is the decimal separator for floating point literals, which might explain the misrepresentations you are seeing.
To test this, try setting to miniAudicle to the "C" locale before running it, by setting the appropriate locale environment variable. Its been a while, but I believe LC_ALL is the right var. For example,
$ export LC_ALL="C" $ miniAudicle
and then proceed as normal. (The locale settings will only apply to the current terminal, so this shouldnt affect anything else on your system.) There are a few more locale-oriented settings that can be manipulated, so some experimentation may be necessary.
If it is a locale issue, then its probably something we can fix in miniAudicle very easily. Let me know!
Thanks, spencer
On Wed, Mar 26, 2014 at 12:50 PM, Antanas Budriūnas
wrote: 2014-03-26 21:23 GMT+02:00 alfredo
: chuck --version
chuck version: 1.3.3.0 (chimera) linux (alsa) : 64-bit http://chuck.cs.princeton.edu/ http://chuck.stanford.edu/
nano float-issue.ck 2.3 => float a; <<< a >>>;
chuck float-issue.ck 2.300000 : (float)
unbelievable... but mini-audicle still doesn't work
can it be the dependencies?
I didn' t use mini but seems (s)hi had the problem long time ago -
https://lists.cs.princeton.edu/pipermail/chuck-users/2006-November/001309.ht...
Antanas Budriūnas _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Cool. Ill make a fix for the next release that automatically sets this (for
miniAudicle only), but it looks like you have a workaround for now.
spencer
On Wed, Mar 26, 2014 at 1:26 PM, alfredo
Hi spencer/all...
finally! it seems that is a locale problem. doing export LC_ALL="C" before running miniaudicle it works perfectly.
thanks a lot... hope it helps to fix that.
thanks to everybody for the quick answer.
still congratulations for the excellent language/software that personally i love.
sincerely, alfredo
2014-03-26 21:15 GMT+01:00 Spencer Salazar
: Hey Alfredo/all,
I dont have any specific recollection of this issue coming up, but the thread Antanas has linked to is promising. It could be a locale issue, which sadly seems to still be an issue in some situations :( One side effect of these is software being confused whether , or . is the decimal separator for floating point literals, which might explain the misrepresentations you are seeing.
To test this, try setting to miniAudicle to the "C" locale before running it, by setting the appropriate locale environment variable. Its been a while, but I believe LC_ALL is the right var. For example,
$ export LC_ALL="C" $ miniAudicle
and then proceed as normal. (The locale settings will only apply to the current terminal, so this shouldnt affect anything else on your system.) There are a few more locale-oriented settings that can be manipulated, so some experimentation may be necessary.
If it is a locale issue, then its probably something we can fix in miniAudicle very easily. Let me know!
Thanks, spencer
On Wed, Mar 26, 2014 at 12:50 PM, Antanas Budriūnas
wrote: 2014-03-26 21:23 GMT+02:00 alfredo
: chuck --version
chuck version: 1.3.3.0 (chimera) linux (alsa) : 64-bit http://chuck.cs.princeton.edu/ http://chuck.stanford.edu/
nano float-issue.ck 2.3 => float a; <<< a >>>;
chuck float-issue.ck 2.300000 : (float)
unbelievable... but mini-audicle still doesn't work
can it be the dependencies?
I didn' t use mini but seems (s)hi had the problem long time ago -
https://lists.cs.princeton.edu/pipermail/chuck-users/2006-November/001309.ht...
Antanas Budriūnas _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
participants (4)
-
alfredo
-
Antanas Budriūnas
-
Brian Sorahan
-
Spencer Salazar