mathstodon.xyz is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance for maths people. We have LaTeX rendering in the web interface!

Server stats:

2.8K
active users

#cpp23

0 posts0 participants0 posts today

#cpp23

Printing limits for the type 'std::bfloat16_t' (2 bytes):'
Lowest  : -3.3895314e+38
Min     : 1.1754944e-38
Max     : 3.3895314e+38
Digits  : 8 
Digits10: 2
------------
Printing limits for the type 'std::float16_t' (2 bytes):'
Lowest  : -65504
Min     : 6.1035156e-05
Max     : 65504
Digits  : 11
Digits10: 3
------------
Printing limits for the type 'std::float32_t' (4 bytes):'
Lowest  : -3.4028235e+38
Min     : 1.1754944e-38
Max     : 3.4028235e+38
Digits  : 24
Digits10: 6
------------
Printing limits for the type 'std::float64_t' (8 bytes):'
Lowest  : -1.7976931348623157e+308
Min     : 2.2250738585072014e-308
Max     : 1.7976931348623157e+308
Digits  : 53
Digits10: 15
------------
Printing limits for the type 'std::float128_t' (16 bytes):'
Lowest  : -1.189731495357231765085759326628007e+4932
Min     : 3.3621031431120935062626778173217526e-4932
Max     : 1.189731495357231765085759326628007e+4932
Digits  : 113 
Digits10: 33
------------

🎉 🎉 C23 and C++23 are finally joining the quadruple precision club, by bringing a standard way to handle 128-bit floating point numbers!
(FP16 is also here if you need it)

Here is hoping that a future Fortran standard will adopt the C_Float128 kind specifier that gcc/gfortran already has as an extension.
en.cppreference.com/w/cpp/type

en.cppreference.comFixed width floating-point types (since C++23) - cppreference.com
#c23#cpp23#cpp

Considering starting my next C++ game engine using modules to replace #include. Maybe a bad idea but hey we'll find out!

What's some other cool tech worth checking out? atm the plan is:
- #cpp23 or 26, whichever #NixOS supports
- #CMake, though I am curious to learn about other build systems
- #SDL 3.0, and its new SDL_GPU api (I know nothing about it but it looks awesome)
- #dearimgui (docking) to build the interface

Using tags so I hopefully reach the right people :)
#customengine #linux

Triggering a compile-time error from consteval function is harder than it should be.

One would expect static_assert to work, but when you need to assert preconditions on function parameters, you can't use that.

You have to either invoke undefined behavior (as it triggers compile error in consteval context) or invoke a non-constexpr method.

If you need a description for the error message, the method name is your error message!

Gotta love the C++ standard library (sarcasm).

It adds std::osyncstream in C++20 which synchronizes writes to a wrapped stream across threads.

And then it adds std::print in C++23 which replaces normal stream operations and accepts a stream reference to which it should write.

Except... for some reason it converts that stream to FILE* which means that any synchronization capabilities of osyncstream are lost, making you fumbling why a perfectly legal C++ code misbehaves.

At least if they'd explicitly deleted that overload...