seg_fault
seg_fault on Hacker News
I had the same experience. C++ doesn't even compile or I have to tell it all the time "use C++23 features". I tried to learn OpenGL with it. This worked out a bit, since I had to spot the errors :D
What kept me as an intern during education is the feedback and the nerdy chitchat. Developing as an intern in a team, where you have your own project and the possibility to chat with experienced people from various fields can be a huge impact. I had no deadlines, so if someone proposed a better way to do something I tried it and I learnt a lot from that.
Besides, talking to other people face to face about your project always gave me a huge motivation boost.
Awesome! The fold up mechanism is a great idea to make it look clean, when there is no party and it also saves the hardware from dust :D
My type is a bit simpler. But I think the approach is the same. After all, boost's type has much more math functions implemented. I don't have exp, sqrt...
If I understand this correctly GMP has a flexible mantissa with no limitations during runtime.
In fas you have to specify the sizes (of mantissa and exponent) during compile time. So the size of this type is fixed. Thus, there is no heap involved.
Somebody wants to use it? :D
I thought about something like where people can use it but have to make changed public. I am just curious, what should be changed. But I dont think there is actually a real world use case.
I remember that I tried that some time ago. Especially the multiplication was tough, but I can not recall where I gave up. When I find some time, I will pick it up again :)
Sure.
Float<int64_t, int64_t>
Gives you a signed Mantissa with 64 bit and a signed Exponent with 64bit. Since there are numeric limits for int64_t available, Float knows the max and the min value.
You could get even bigger ranges for Float by implementing your own big integer type.
I don't get what you mean. I thought they specify how the type can be used?
Actually you can specify the numeric limits of the mantissa and the exponent.
They can be specified as template arguments[0].
So you could do:
Float<uint8_t, // type of the mantissa
uint8_t, // type of the exponent
0, // lowest possible value of the mantissa
4095, // highest possible value of the mantissa
0, // lowest possible value of the exponent
7> // highest possible value of the exponent
The Float then simulates an unsigned 12bit mantissa and a 3bit exponent. Sure it still takes 16 bytes. But you could create a union with bitfields where you shrink that even further.
[0] https://github.com/clemensmanert/fas/blob/58f9effbe6c13ab334...
Rounding: actually it just cuts off. I have not spent much time to think about how to specify and implement the different rounding modes. Maybe some day...
Thanks for the hint to the paper. I also faced these issues. Thus, I provided a constructor which accepts mantissa and exponent as values. Very handy for the unittests.
Posted by
seg_fault on Friday October 18, 2024 @01:42PM
from the show-hn dept.
https://github.com/clemensmanert/fas
Since there is so much interest on HN in floats lately and their software implementations, I wanted to show mine. It has no use and is just for teaching me floats and C++. Give me your thoughts.
I do. And a lot of my neighbors. In Germany it is pretty common to to have a few chicken in the backyard in countryside areas. My parents life in the Munich suburban belt and even have a rooster in their flock. Their neighbors have not complained so far.
They eat snails and all the kitchen scaprs and I seldom have to buy eggs. Besides, it is so lovely to watch them in the garden. Their social live and their communication within the flock is very interesting to watch.
There are also a lot of nice hacker projects out: self closing chicken coop, monitoring, live cams.
And they really look nice, there are so many beautiful breeds, just type chicken breed in duckduckgo image search.
Posted by
seg_fault on Saturday September 14, 2024 @05:59PM
from the show-hn dept.
https://github.com/clemensmanert/dotfiles
I developed a solution to manage color themes for my dotfiles efficiently. By using a Makefile alongside the Mustache templating engine, I can switch between a dark theme for nighttime and a light theme for daytime with a single command.Each color theme is defined in its own file, allowing for easy creation of new themes without the need to modify every individual dotfile. This approach...
I'm a software developer with 3 years experience. I'm looking for a remote job in the C/C++ field. I'm interested in low-level/embedded.
Location: Germany
Remote: Yes preferred
Willing to relocate: No
Technologies: C/C++, Ada, Linux
Résumé/CV: http://manert.de/cv.pdf
Email: [email protected]
Github: https://github.com/clemensmanert