f32Lit
On this page

f32Lit()

Function in Emit

Spell v as an f32 literal, in the form WGSL and GLSL share: an integer-looking value gets a .0 suffix so a float context never sees an integer literal.

import { f32Lit } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

function f32Lit(v: number): string

Parameters

v number

Return value

string

Exceptions

SD0017

SD0017 if v is not finite. Neither WGSL nor GLSL has a NaN or Infinity literal, so String(v) would place an unparseable token in the module.

Source

src/core/backends/wgsl.ts, line 146, at commit 26de7be8

Edit this page Report a problem