Stream: beginners

Topic: horrible experience with floats


view this post on Zulip Artur Swiderski (May 28 2023 at 19:34):

I started to do a little bit of code involving floats operation on recent build. Experience is horrible dbg crashing constantly , simple stuff like Num.floor, Num.rond crashing , Dec numbers practically unusable. Do you know older builds where those things used to work better. Btw I was mentioning that but when I create a lot of tags and to some of them I attach floats , hell breaks loose, it is extremely difficult to do anything with such constructions later on. all the time I have to specify how every single tag should be serviced I can't group them in any way because there is implicit assumption that floats may be there in every path (and since Dec does not work I have to stick to F32-64)

view this post on Zulip Richard Feldman (May 28 2023 at 20:57):

hey sorry to hear you're having a frustrating experience, sounds like we have a cluster of bugs you ran into

view this post on Zulip Richard Feldman (May 28 2023 at 20:57):

to improve things we need to know where the problems are specifically, so we know what to fix - do you think you could find ways to reproduce some of these crashes and bugs?

view this post on Zulip Artur Swiderski (May 28 2023 at 21:16):

on recent build Num.floor , Num.round are crashing Str.toDec crashing at least for me

view this post on Zulip Artur Swiderski (May 28 2023 at 21:33):

dbg crashes often but in order to report problem I need to submit quite a decent chunk of code. I will consider doing so anyway. For problem I mentioned simple things like lines " r = Num.floor 1.1f32" , " Str.toDec "50" " are crashing. Those seems like rudimentary operations and for them not working is disappointing. Crashing dbg I can swallow, but I don't know how to go around crashing Num.floor or Num.round . Btw I am beginner in FP so experiencing additional hurdles all the time does not help

view this post on Zulip Brendan Hansknecht (May 28 2023 at 21:35):

This is quite informative. I guess no one has really done anything significant with floating point or decimal types yet.

view this post on Zulip Brendan Hansknecht (May 28 2023 at 21:36):

dbg is less surprising to me. It tends to crash in a lot of situations and is a more complex picture.

view this post on Zulip Brendan Hansknecht (May 28 2023 at 21:36):

I'll try to look into filling out our test suite and figuring out what is missing for floats.

view this post on Zulip Artur Swiderski (May 28 2023 at 21:38):

actually my goal was to accomplish some basic functionality, so when I meet some kind of problem usually I am focused more on trying bypass it but maybe I should focus more on reporting I will see next week

view this post on Zulip Artur Swiderski (May 28 2023 at 21:41):

floats are important since roc premise is to be relatively performant it is natural that it will be used to perform some computations at least I plan to use it this way

view this post on Zulip Luke Boswell (May 28 2023 at 22:49):

Yes, submitting issue whenever you find a bug is very helpful :grinning:

view this post on Zulip Brendan Hansknecht (May 29 2023 at 01:41):

I haven't managed to repro the Num.floor issue, but I think I figured out the Str.toDec issue. Actually turned out not to be an issue with Str.toDec, but with Num.toStr on the dec to print it out. Will push a fix shortly.


Last updated: Jul 06 2025 at 12:14 UTC