Weird temperature things (nan, ±inf)

  • alice_loona_OT12
    26th Dec 2020 Member 0 Permalink

    3 4 elements with temperatures of nan, -nan(ind), inf, and -inf.

     

    poopa = 9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9
    poopb = poopa*poopa*poopa*poopa*poopa*poopa*poopa*poopa*poopa*poopa
    inf = poopb*poopb*poopb*poopb*poopb*poopb*poopb*poopb*poopb*poopb
    
    inf=inf+1
    
    nan=inf/inf
    nan=nan+1
    
    ninf = inf*-1
    ninf=ninf-1
    
    local function setFunnyTemps()
        tpt.set_property("temp", nan, "NNANT") --counterintuitively, this gives -nan(ind) to NNANT
        tpt.set_property("temp", -nan, "NANT")  --counterintuitively, this gives nan to NANT
        tpt.set_property("temp", inf, "INFT")
        tpt.set_property("temp", ninf, "NIFT")
    end
    tpt.register_step(setFunnyTemps)
     
    elements.allocate('IDKLOL', 'NANT')
    elements.element(elements.IDKLOL_PT_NANT, elements.element(elements.DEFAULT_PT_GLOW))
    elements.property(elements.IDKLOL_PT_NANT, 'Name', 'NANT')
    elements.property(elements.IDKLOL_PT_NANT, 'Description', 'NaN temperature')
    elements.property(elements.IDKLOL_PT_NANT, 'Color', '0x7f7f7f')
    elements.property(elements.IDKLOL_PT_NANT, 'MenuSection', '7')
    elements.property(elements.IDKLOL_PT_NANT, 'HeatConduct', '511')
    local g = function(i, x, y, s, n)
    --Update Function
    end
    tpt.element_func(g, tpt.element('NANT'))
    
    elements.allocate('IDKLOL', 'INFT')
    elements.element(elements.IDKLOL_PT_INFT, elements.element(elements.DEFAULT_PT_GLOW))
    elements.property(elements.IDKLOL_PT_INFT, 'Name', 'INFT')
    elements.property(elements.IDKLOL_PT_INFT, 'Description', 'inf temperature')
    elements.property(elements.IDKLOL_PT_INFT, 'Color', '0xffffff')
    elements.property(elements.IDKLOL_PT_INFT, 'MenuSection', '7')
    elements.property(elements.IDKLOL_PT_INFT, 'HeatConduct', '511')
    local g = function(i, x, y, s, n)
    --Update Function
    end
    tpt.element_func(g, tpt.element('INFT'))
    
    elements.allocate('IDKLOL', 'NIFT')
    elements.element(elements.IDKLOL_PT_NIFT, elements.element(elements.DEFAULT_PT_GLOW))
    elements.property(elements.IDKLOL_PT_NIFT, 'Name', 'NIFT')
    elements.property(elements.IDKLOL_PT_NIFT, 'Description', '-inf temperature')
    elements.property(elements.IDKLOL_PT_NIFT, 'Color', '0x101010')
    elements.property(elements.IDKLOL_PT_NIFT, 'MenuSection', '7')
    elements.property(elements.IDKLOL_PT_NIFT, 'HeatConduct', '511')
    local g = function(i, x, y, s, n)
    --Update Function
    end
    tpt.element_func(g, tpt.element('NIFT'))

    elements.allocate('OVVO', 'NNANT') elements.element(elements.OVVO_PT_NNANT, elements.element(elements.DEFAULT_PT_GLOW)) elements.property(elements.OVVO_PT_NNANT, 'Name', 'NNANT') elements.property(elements.OVVO_PT_NNANT, 'Description', '-NaN temperature') elements.property(elements.OVVO_PT_NNANT, 'Color', '0x7f7f7f') elements.property(elements.OVVO_PT_NNANT, 'MenuSection', '7') elements.property(elements.OVVO_PT_NNANT, 'HeatConduct', '511') local g = function(i, x, y, s, n) --Update Function end tpt.element_func(g, tpt.element('NNANT'))
    Edited 3 times by JohnSmith777779. Last: 27th Dec 2020
  • RegisteredUser
    3rd Jan 2021 Member 0 Permalink
    inf = math.huge
    nan = inf/inf

    P.S. tpt rounds down "inf" values
    Edited 4 times by RegisteredUser. Last: 3rd Jan 2021