MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:bhildred Date:June 24 1999 1:43pm
Subject:Re: Question about float truncating
View as plain text  
this is a simple one, use a larger data type. As a programer who is new
to SQL it looks as if your data is being stored in a bcd array wit only
eight didgets for e storing yor mantesa and one or two for your
exponent. quite simply you have exceded the precision of the mantesa.

have fun.
ben

PS. Please excuse my pore spelling.

Technische Dienst wrote:
> 
> Hey there,
> 
> I have a question on how my float reacts that I can't find back in the help. I'm not
> a native english speaker so I might just be reading over it.... Anyways here it comes.
> 
> I made a table like this:
> create table towers (Art_Num int(5) primary key, Art_Name text, Art_Price
> float(4,2));
> Gives msg ok table created or something like that.
> Then I do:
> insert into towers values (88888888, "Some item", 666666.4444);
> insert into towers values (88888889, "Some item", 7777777.55555);
> insert into towers values (88888899, "Some item", 88888888.666666);
> insert into towers values (88888999, "Some item", 999999999.7777777);
> insert into towers values (88889999, "Some item", 999965432.1234567);
> 
> Now "select * from towers;" will give
> 
> Art_Num            Art_Name            Art_Price
> 88888888           Some item           666666.44             This is ok
> 88888889           Some item           7777777.50            Where did my other 5
> go?
> 88888899           Some item           88888888.00          Where did the 67 go?
> 88888999           Some item           1000000000.00       Uhm??
> 88889999           Some item           999965440.00         Uh?
> 
> I see no logic in the way of truncating...
> also art_num is an int(5) how can it ever display 8 numbers?
> and the art_price is float(4,2) how can there be 10 numbers infront of the dot?
> 
> We're running the MySQL binary distribution for linux (i686) version 3.22.23b on
> Slackware 3.6 kernel version 2.0.35....
> 
> Any ideas? I don't think this is a bug so I didn't do the bug stuff, but if you need
> it I'll get it.
> 
> Thanks for your time,
> 
> Ferry van Steen
Thread
Question about float truncatingTechnische Dienst24 Jun
  • Re: Question about float truncatingbhildred24 Jun