ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:intdiv

Table of Contents

IntDiv

fixed IntDiv(int a, int b)

Description

Divides two integers and returns a fixed-point result. Allows division of any two integers whose ratio is not higher than 32767.

Can be used as a shorthand for FixedDiv(a<<16, b<<16).

For a safe version see SafeIntDiv.

Examples

IntDiv(3, 2) -> 1.5
IntDiv(123456, 123) -> 1003.707
functions/intdiv.txt · Last modified: 2017/04/15 17:20 by korshun