News for hackers. Stuff that matters.
Re:Why does 0.1 and 0.2 = 0.30000000000000004? by HNDen21 on Wednesday February 08, 2023 @03:37PM (#34714662)
same in SQL Server

   declare @i float =0.37,@times int = 0,@total float = 0

   while @times < 5000
   begin
   set  @total+=  @i
   set @times +=1
   end

   select @total
1849.99999999977

or

   select sum(t) from(
   select top 5000 convert(float, 0.37) t 
   from sysobjects a cross join sysobjects b) z
1849.99999999977

There are no comments on this comment yet.