ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:safefixeddiv

Table of Contents

SafeFixedDiv

fixed SafeFixedDiv(fixed num, fixed den)

Description

Performs safe division: if denumerator is 0, the result is 0 and no error happens.

Fixed-point version, for integers see SafeDiv.

Examples

SafeFixedDiv(6.0, 3.0) -> 2.0
SafeFixedDiv(6.0, 0.0) -> 0
SafeFixedDiv(6.0, 5.0) -> 1.2
functions/safefixeddiv.txt · Last modified: 2017/03/17 17:41 by korshun