crystal
crystal copied to clipboard
The Crystal Programming Language
Example PR that deprecates `Atomic::Flag` and replaces its few usages in stdlib. The API doesn't follow the usual definition of "test and set", and the use cases are fairly limited...
`Time#inspect` produces a format that is roughly equivalent to `to_s("%F %T.%N %::z %Z")`. But there are some special cases: * automatically trims insignificant digits of nanoseconds * omits seconds in...
``` require"big" pi="3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587".to_big_d puts pi.round(100) puts "%.100f"%pi ``` ``` 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068 3.1415926535897931159979634685441851615905761718750000000000000000000000000000000000000000000000000000 ``` https://play.crystal-lang.org/#/r/hfg9
## Bug Report It appears the merged fix for https://github.com/crystal-lang/crystal/issues/15742 is incomplete. I've just pulled the latest git HEAD (commit `445ef91760097bc80e353db3aa8770ee33a6d02c`) and am trying to run the `stdlib` specs using...
Crystal's `Time` type supports time zone offsets with a resolution of seconds. But not all time formats support such a high resolution. In fact, none of the custom formatters provided...
These missing methods were detected while exploring https://github.com/crystal-lang/crystal/issues/13409
The semantics of the test-and-set instruction was established back in 1951 on the EDSAC2 and has been propagated in many implementations since: an atomic operation that tests a flag, sets...
Hi! This is similar to #15421 and #15480 ```cr x = if true 3 else 4 end y = unless false 3 else 4 end ``` Only the `if` assignment...
The biggest advantage of MinGW-w64 Crystal over the MSVC-based equivalent is that a wide selection of third-party libraries' development files are available via Pacman, the package manager for MSYS2, and...