Help Center
Help CenterFreeBASIC

CSignkeyword

Converts an expression to signed

Converting Data Typeskeyworddocumented

Syntax

CSign ( expression )

Description


Converts an unsigned expression to a signed one, useful to force signed behavior of division or multiplication (including with Shl and Shr).

This is the opposite of CUnsg.

Remarks

Usage


variable = CSign ( expression )

Dialect Differences


  • Not available in the -lang qb dialect unless referenced with the alias __Csign.

Differences from QB


  • New to FreeBASIC

See also


Example


Dim value As UShort = 65535

Print CSign(value)  '' will print -1


Reference

  • Documented in KeyPgCsign.html