m (→top: template removal and cleanup) |
CrazyBoy826 (talk | contribs) (Cleaned up and updated as part of the Full Wiki Cleanup) (canned edit summary) |
||

Line 8: | Line 8: | ||

|removed = [[1.2]] | |removed = [[1.2]] | ||

}} | }} | ||

− | The '''abs ()''' [[Blocks|block]] was a [[Operators Blocks|Numbers block]] and a [[Reporter Block|Reporter block]]. The block reports the absolute value of the [[ | + | The '''abs ()''' [[Blocks|block]] was a [[Operators Blocks|Numbers block]] and a [[Reporter Block|Reporter block]]. The block reports the absolute value of the input. It was replaced with [[() of () (Operators block)|() of ()]] block in [[Scratch 1.2]], which contains many more mathematical functions. |

− | The absolute value is the distance of a number from 0. Another way to describe absolute value is that it makes a number positive{{-}}if it is negative, it becomes positive, and if it is positive, it stays positive. For example, the absolute value of -3 is +3 and the absolute value of +4 is +4. The mathematical way to write absolute value is |number|. For example, abs(-3) is the same as |-3|. | + | The absolute value is the distance of a number from 0. Another way to describe absolute value is that it makes a number positive {{-}} if it is negative, it becomes positive, and if it is positive, it stays positive. For example, the absolute value of -3 is +3 and the absolute value of +4 is +4. The mathematical way to write absolute value is |number|. For example, abs(-3) is the same as |-3|. |

== Removal == | == Removal == | ||

Line 27: | Line 27: | ||

</scratchblocks> | </scratchblocks> | ||

− | + | It could also be replicated with the block that replaced it. | |

<scratchblocks> | <scratchblocks> | ||

− | ([abs v] of ( | + | ([abs v] of ()) |

</scratchblocks> | </scratchblocks> | ||

== See Also == | == See Also == | ||

− | *[[() of () (Operators block | + | *[[() of () (Operators block)]] |

{{Operators Blocks}}{{Removed Blocks}} | {{Operators Blocks}}{{Removed Blocks}} | ||

[[Category:Operators Blocks]] | [[Category:Operators Blocks]] | ||

[[ja:() の絶対値 (ブロック)]] | [[ja:() の絶対値 (ブロック)]] |

## Revision as of 20:10, 11 January 2020

This article or section documents something not included in the current version of Scratch (3.0). It is only useful from a historical perspective. For information on the feature that replaced this one, see () of () (Operators block). |

abs () | |

Category |
Numbers |

Type |
Reporter |

Introduced in |
1.0 |

Removed in |
1.2 |

The **abs ()** block was a Numbers block and a Reporter block. The block reports the absolute value of the input. It was replaced with () of () block in Scratch 1.2, which contains many more mathematical functions.

The absolute value is the distance of a number from 0. Another way to describe absolute value is that it makes a number positive — if it is negative, it becomes positive, and if it is positive, it stays positive. For example, the absolute value of -3 is +3 and the absolute value of +4 is +4. The mathematical way to write absolute value is |number|. For example, abs(-3) is the same as |-3|.

## Removal

In Scratch 1.2, this block was removed, and replaced with a general () of () block. It contains 12 mathematical functions. The top value is abs, but the default is sqrt (square root).

Its position in the palette was between () mod () and round (). The new block is at the bottom of the palette.

## Workaround

This block could be replicated with the following code:

if <(num) < (0)> then set [abs v] to ((num) * (-1)) else set [abs v] to (num) end

It could also be replicated with the block that replaced it.

([abs v] of ())

## See Also

() + ()
• () - () • () * () • () / () • Pick Random () to () • () < () • () = () • () > () • () and () • () or () • Not () • Join ()() • Letter () of () • Length of () • () Mod () • Round () • () of ()More blocks... |