Math "fraction" and "modulo of one" node outputs 1.000 #98877

Closed
opened 2022-06-14 11:34:17 +02:00 by Avi Cohen · 9 comments

System Information
Operating system: Windows 11
Graphics card: NVIDIA GeForce RTX 3080 Laptop GPU

Blender Version
Broken: 3.2.0

Short description of error
Math "fraction" node and "modulo of one" can output one, it probability has to do with precision.
It's happening when trying to perform on fractions bigger than 0.9995.
The same problem for both shader nodes and geometry nodes.

Example and way to reproduce:

  1. input: 0.9995 output: 0.999
  2. input: 0.9996 output: 1.000
    math fraction output one.jpg

Work around
Work around for the mean time, you can use "less than" and multiply the resalt by the fraction resalt. i've found threshold value of 0.9995 to work.

this if basically the same as doing:
if fraction is greater than 0.9995 return 0 else return the fraction
work around.jpg

**System Information** Operating system: Windows 11 Graphics card: NVIDIA GeForce RTX 3080 Laptop GPU **Blender Version** Broken: 3.2.0 **Short description of error** Math "fraction" node and "modulo of one" can output one, it probability has to do with precision. It's happening when trying to perform on fractions bigger than 0.9995. The same problem for both shader nodes and geometry nodes. Example and way to reproduce: 1) input: 0.9995 output: 0.999 2) input: 0.9996 output: 1.000 ![math fraction output one.jpg](https://archive.blender.org/developer/F13161407/math_fraction_output_one.jpg) **Work around** Work around for the mean time, you can use "less than" and multiply the resalt by the fraction resalt. i've found threshold value of 0.9995 to work. this if basically the same as doing: if fraction is greater than 0.9995 return 0 else return the fraction ![work around.jpg](https://archive.blender.org/developer/F13161686/work_around.jpg)
Author

Added subscriber: @AviCohen

Added subscriber: @AviCohen

Added subscriber: @mod_moder

Added subscriber: @mod_moder

This is not a bug, but a problem of format accuracy limitations?

This is not a bug, but a problem of format accuracy limitations?
Author

if you mean it's the format of the output than no, it actually affects the result
without the work around
1.jpg
with the work around
2.jpg

by the way, for the work around i ment "less than" not "bigger than". i will fix it in the discription.

if you mean it's the format of the output than no, it actually affects the result without the work around ![1.jpg](https://archive.blender.org/developer/F13161678/1.jpg) with the work around ![2.jpg](https://archive.blender.org/developer/F13161680/2.jpg) by the way, for the work around i ment "less than" not "bigger than". i will fix it in the discription.
Contributor

Added subscriber: @scurest

Added subscriber: @scurest
Contributor

This works for me. To rule out being a formatting issue, can you put a multiply x1000 node in front of the fraction node and check the spreadsheet? If the fraction output is really 0.9997, the multiply will make it 999.700.

nodes3.png

This works for me. To rule out being a formatting issue, can you put a multiply x1000 node in front of the fraction node and check the spreadsheet? If the fraction output is really 0.9997, the multiply will make it 999.700. ![nodes3.png](https://archive.blender.org/developer/F13165630/nodes3.png)

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Needs Triage' to: 'Archived'

Changed status from 'Needs Triage' to: 'Archived'

I'm not seeing a bug here.
For me what is happening is: The numbers in the Spreadsheet interface only have space for 3 decimal places, so, for visualization, it rounds the value.

The actual value is not affected.

I'm not seeing a bug here. For me what is happening is: The numbers in the Spreadsheet interface only have space for 3 decimal places, so, for visualization, it [rounds ](https://en.wikipedia.org/wiki/Rounding) the value. The actual value is not affected.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#98877
No description provided.