Skip to content

Instantly share code, notes, and snippets.

@JacquesLucke
Created December 12, 2019 13:04
Show Gist options
  • Select an option

  • Save JacquesLucke/a30303ce4c7d9c3242885f4da7b4412d to your computer and use it in GitHub Desktop.

Select an option

Save JacquesLucke/a30303ce4c7d9c3242885f4da7b4412d to your computer and use it in GitHub Desktop.

Revisions

  1. JacquesLucke created this gist Dec 12, 2019.
    4 changes: 4 additions & 0 deletions map_random_int_to_01.c
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    uint a = BLI_rng_get_uint(rng);
    uint b = 0x3F800000 | (0x007FFFFF & a);
    float c = *(float *)&b;
    return c - 1.0f;