fixsqrt(3alleg4)
π fixsqrt β bestie edition π
okay so this is a page from the Allegro manual, section 3alleg4 β it's the fixed point square root situation, and yes it's part of the Allegro game programming library. sit down, hydrate, let's go π«Ά
β¨ SYNOPSIS β¨
#include <allegro.h>
fixed fixsqrt(fixed x);
literally that's it. one function. one job. she's simple, she's efficient, she's an icon π
πΈ DESCRIPTION πΈ
so fixsqrt finds the non negative square root of x. that's the whole vibe β you hand her a fixed value, she hands you back the square root of it. slay β¨
but here's the part where you gotta pay attention bestie π β if x is negative, it does NOT just wing it. no ma'am. instead:
errnogets set toEDOMπ- and the function returns zero
so like. if you're out here passing negative numbers and then wondering why you got a 0 back, that's not a bug, that's the function being honest with you. check your errno, bestie, she's trying to tell you something π
fr fr: negative input =EDOMinerrno+ a0return value. no cap.
π SEE ALSO π
the rest of the girlies in this friend group:
(yes the comma at the front is in the original, she's just quirky like that π)
π sign-off π
this page is from Allegro, version 4.4.3, and it belongs to the fixsqrt(3alleg4) manual page. go forth and square root responsibly, you absolute main character ππβ¨
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms