ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:safediv

This is an old revision of the document!


Table of Contents

SafeDiv

int SafeDiv(int num, int den)

Description

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

Integer version, for fixed-point numbers see SafeFixedDiv().

Examples

SafeDiv(6, 3) -> 2
SafeDiv(6, 0) -> 0
functions/safediv.1489419264.txt.gz · Last modified: 2017/03/13 17:34 by korshun