#linuxcnc-devel Logs

Oct 09 2022

#linuxcnc-devel Calendar

11:33 AM -!- #linuxcnc-devel mode set to +v by ChanServ
11:50 AM pere: roguish[m]: just let me know how you want to move forward with the floating point divide component.
02:16 PM roguish[m]: pere: here it is.
02:17 PM * roguish[m] posted a file: div2.c (1KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/OMYhMPQspkHGqUQrYzoBEwjP >
02:17 PM * roguish[m] posted a file: (1KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/IdWHuvuuvshTOHvqKNaPsfJN/div2.comp >
02:17 PM * roguish[m] posted a file: (25KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/LHfsxOBDFUXJwVgKprbvPAVe/div2.so >
02:18 PM roguish[m]: it's just like 'mult2' comp, only divide instead of multiply.
02:19 PM pere: do I need more than the .comp file?
02:19 PM pere: roguish[m]: do you want to learn how to submit it?
02:19 PM roguish[m]: I have not idea. I think you have to put the .c in the source, don't you?
02:20 PM roguish[m]: with the C file in source, doesn't it get complied and included with all Linuxcnc?
02:22 PM roguish[m]: you could add my name up in the comments in the .c file......it's ok.
02:22 PM roguish[m]: just for a tiny bit of credit. and add yours too.
02:32 PM pere: roguish[m]: I believe only the .comp file should be needed and the C and .so file is generated from that.
02:33 PM pere: roguish[m]: it need more documentation, though. there is no author and description fields. can you add some?
02:34 PM pere: should perhaps mention what happen if in1 is zero, or nan, or something like that?
02:37 PM roguish[m]: do you have an example of a file with documentation?
02:38 PM roguish[m]: I was not good enough to put the divide by zero error check in it.....but can mention it in the dos
02:38 PM roguish[m]: doc
02:38 PM roguish[m]: but that should be obvious.
02:39 PM pere: roguish[m]: sure, <URL: https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/components/carousel.comp > got lots of it
02:40 PM pere: if your div2.comp is placed next to the other .comp files, it will be included in the build.
02:55 PM -!- #linuxcnc-devel mode set to +v by ChanServ
03:00 PM roguish[m]: pere: so, it looks like that can I put text between """ and """;
03:01 PM roguish[m]: yes?
03:01 PM pere: yes. " " is for single lines, and """ """ are for multilines.
03:22 PM roguish[m]: pere: OK, I added a bit.
03:22 PM * roguish[m] posted a file: (1KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/ukBkWNLDScKPtiULNIewQOmo/div2.comp >
03:23 PM roguish[m]: It would be nice to have the divide by zero error check.... but it's not necessary.
03:23 PM pere: roguish[m]: it mentioned a problem with negative divisor, what is the problem?
03:23 PM roguish[m]: I tried, but I suck at programming.
03:24 PM roguish[m]: I could not get it to compile with the comp maker thing
03:24 PM pere: I could propably program it, but have i idea how to return an error when it happen.
03:25 PM roguish[m]: like I said. it's not really necessary. anyone using it should know not to divide by zero.....
03:25 PM roguish[m]: put it in now. If I can get it to handle the error, it can be updated.
03:26 PM roguish[m]: I appreciate your help.
03:46 PM pere: the code is in the C language, and if (0.0 == in1) { do some error reporting } is the naive approach to handle divide by zero. but floating point comparision is hard, so I am not sure if one both need to check against -0.0 and 0.0. suspect there are some math.h methods that can be used. rarely program floating point in C any more.
03:47 PM roguish[m]: pere: I think I might have figured it out. looking at other comp files with the error message in them. I will have to test it....
03:48 PM roguish[m]: I have a new VM that I can use
03:48 PM pere: very good.
03:49 PM roguish[m]: I'm sure it can make it into 2.9
03:49 PM pere: you or I can prepare the pull request, at least. I did some to add new components lifted from machinekit, if you want to see an example pull request.
03:51 PM roguish[m]: let me get it to totally work, and I'll ping you. could be a few days
04:06 PM pere: roguish[m]: ok
06:06 PM roguish[m]: pere: still here? well i did some work. added some doc lines, and the error check. it compiles and installs, but the error part is not working yet. I will check with some better programmers.....